package com.loacadata.demo.controller;

import com.loacadata.demo.dto.UserDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HelloController
 * @description: TODO
 * @author: 朱同学
 * @Date 2021/4/9 22:20
 **/
@Slf4j
@RestController
public class HelloController {

    @PostMapping("getUser")
    public UserDto getUser(@RequestBody UserDto userDto) throws Exception {
        log.info("UserDtoInfo name {} birthday {} class {}", userDto.getName(), userDto.getBirthday(), userDto.getBirthday().getClass());
        log.info("localData year {} month {} day {}", userDto.getBirthday().getYear(), userDto.getBirthday().getMonthValue(), userDto.getBirthday().getDayOfMonth());
        return userDto;
    }

}
